
<script setup lang="ts">
  import { onMounted } from 'vue'

  // 获取url里code值
  const getUrlCode = (name: any) => {
    let reg = ((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)')).exec(location.href) || [, ''])[1].replace(/\+/g, '%20')
    return decodeURIComponent(reg) || null
  }

  onMounted(() => {
    const code = getUrlCode('code')
    window.location.href = import.meta.env.VITE_BASE_PAGE + 'login?code=' + code
  })
</script>